package com.boyi;

import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.hibernate.validator.HibernateValidator;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;

/**
 * @author Administrator
 */
@SpringBootApplication
@EnableAspectJAutoProxy
@EnableDiscoveryClient
@EnableAdminServer //开启监控功能
@EnableEurekaClient //Spring Boot Admin 注册到 Eureka 里
public class SpringAdminApp {

    public static void main(String[] args) {
        SpringApplication.run(SpringAdminApp.class, args);
    }

    @Bean
    public LocalValidatorFactoryBean localValidatorFactoryBean() {
        LocalValidatorFactoryBean localValidatorFactoryBean = new LocalValidatorFactoryBean();
        localValidatorFactoryBean.setProviderClass(HibernateValidator.class);
        return localValidatorFactoryBean;
    }
}


